package com.br.amazongold.webservice;

import java.util.ArrayList;
import java.util.List;

import com.br.amazongold.dao.RasaDAO;
import com.br.amazongold.entidade.Rasa;
import com.example.amazongold.R;
import com.example.amazongold.R.id;
import com.example.amazongold.R.layout;
import com.example.amazongold.R.menu;

import android.support.v7.app.ActionBarActivity;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;

public class EnviarDados extends ActionBarActivity {

boolean enviar;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_enviar_dados);
	}
	
	public void enviarDados (View v){
		TarefaAsync tf= new TarefaAsync(this);
		tf.enviarDadosRasa();
//		tf.enviarDadosLocal();
		
//	ClienteREST cr= new ClienteREST();
//	List<Rasa> rasas;
// 	RasaDAO dao = new RasaDAO(getApplicationContext());
//// 	Rasa rasa=dao.obterId(2);
//	rasas=dao.obterTodos();
//	try {
////		cr.inserirRasaWS(rasa);
//		cr.inserirListaRasa(rasas);
//		System.out.println("Dados enviados com sucesso!");
//	} catch (Exception e) {
//		// TODO Auto-generated catch block
//		e.printStackTrace();
//	}
	}


	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.enviar_dados, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// Handle action bar item clicks here. The action bar will
		// automatically handle clicks on the Home/Up button, so long
		// as you specify a parent activity in AndroidManifest.xml.
		int id = item.getItemId();
		if (id == R.id.action_settings) {
			return true;
		}
		return super.onOptionsItemSelected(item);
	}
}
